#ifndef TIANTIANSPIDER_H
#define TIANTIANSPIDER_H

#include <QObject>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QNetworkAccessManager>

typedef struct __funData{
    QString name;
    QString code;
    QString stringData;
    int timestamp;
    float rate;
    float valuation;
}funData_t;

class TiantianSpider : public QObject
{
    Q_OBJECT
public:
    explicit TiantianSpider(QObject *parent = nullptr);
    ~TiantianSpider();

    void ask(QString code);
    QList<QString> getList();

private:
    QList<QString> resultList;
    QNetworkAccessManager* accessManger;
    void clear();
    void analyze(QString str);

signals:
    void finished(bool);

private slots:
    void requestFinished(QNetworkReply* reply);
};

#endif // TIANTIANSPIDER_H
